<style scoped>
.warehouseInventory {
  margin-right: 15px;
  padding: 0 15px;
  background-color: white;
  height: 94.5vh;
  position: relative;
}
.wi-top {
  display: flex;
  padding-top: 15px;
}
.wi-top p:first-child {
  margin: 3px 6px 0 0;
  display: inline-block;
  white-space: nowrap;
  /* width: 48px; */
  /* text-align: right; */
}
.wi-top p:not(:first-child) {
  margin: 3px 6px 0 12px;
  display: inline-block;
  white-space: nowrap;
  /* width: 48px;
    text-align: right; */
}
.top_inp {
  width: 160px;
}
.wi-button {
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
}
.wi-button div:nth-child(2) {
  display: flex;
}
.footView span {
  float: left;
  margin-right: 48px;
  line-height: 6vh;
  font-size: 14px;
}
.footView span i {
  margin-right: 5px;
}
#pic {
  position: absolute;
  width: 300px;
  height: 400px;
  box-shadow: 0 3px 3px 3px #f4f4f4;
  bottom: 10%;
  right: 5%;
  background: white;
  z-index: 100;
}
.pic-top {
  display: flex;
  justify-content: space-between;
  padding: 10px 15px;
  background: #f4f4f4;
}
.pic-top p {
  font-weight: 700;
}
</style>

<style>
.warehouseInventory .wi-top .el-input__inner {
  height: 30px;
}
.warehouseInventory .wi-top .el-checkbox.is-bordered {
  padding: 4px 5px 0px 5px;
  margin-left: 12px;
  height: 30px;
}
.warehouseInventory .wi-button .el-checkbox.is-bordered {
  padding: 4px 5px 0px 5px;
  margin-right: 10px;
  margin-left: 0;
  height: 30px;
}
.warehouseInventory .wi-top .el-date-editor .el-range__icon {
  line-height: 24px;
}
.warehouseInventory .wi-top .el-date-editor .el-range-separator {
  line-height: 23px;
}
.el-input__icon {
  line-height: 31px;
}
.warehouseInventory .wi-top .el-date-editor .el-range__close-icon {
  line-height: 25px;
}
</style>

<template>
  <div class="warehouseInventory">
    <!-- 仓库库存表 -->
    <div style="border-bottom:2px solid #f4f4f4;padding-bottom:15px;">
      <div class="wi-top">
        <p>仓库</p>
        <el-input
          @blur="Qname"
          v-model="warehouseNo"
          style="width:60px;margin-right:10px;"
        ></el-input>
        <el-select
          clearable
          style="width:100px;"
          v-model="warehouseName"
          @change="change"
          placeholder="请选择"
        >
          <el-option
            v-for="item in AAList"
            :key="item.value"
            :label="item.label"
            :label1="item.label1"
            :value="item.value"
          >
            <!-- <span style="float:left;margin-right:10px;">{{item.label1}}</span>
            <span style="float:right">{{item.label}}</span> -->
          </el-option>
        </el-select>

        <p>款号</p>
        <el-input
          v-model="kindsNumberListStr"
          class="top_inp"
          placeholder="多个款号以逗号分隔"
        ></el-input>

        <!-- <el-select
          v-model="kindsNumberListStr"
          multiple
          filterable
          collapse-tags
          style="width:170px"
          placeholder="请选择">
          <el-option
            v-for="item in kindsNumberList"
            :key="item.value"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select> -->

        <p style="margin-left:27px">库存</p>
        <el-select
          style="width:80px;margin-right:10px;"
          v-model="stockJudgment"
        >
          <el-option
            v-for="item in stockList"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
        <el-input v-model="stock" style="width:80px;"></el-input>

        <p style="margin-left:28px;">季度</p>
        <el-select
          class="top_inp"
          v-model="quartListStr"
          multiple
          collapse-tags
          placeholder="请选择"
        >
          <el-option
            v-for="item in quartListStrList"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>

        <div
          style="display:flex;margin-left:12px;"
          :style="{ display: showinp }"
        >
          <p>品牌</p>
          <el-select
            class="top_inp"
            clearable
            v-model="brandedId"
            placeholder="请选择"
          >
            <el-option
              v-for="item in brandList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>

          <p>品名</p>
          <el-select
            class="top_inp"
            clearable
            v-model="CommodityNameId"
            placeholder="请选择"
          >
            <el-option
              v-for="item in nameList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </div>

        <el-checkbox
          v-model="conditionQuery"
          label="多条件查询"
          border
        ></el-checkbox>
      </div>

      <div class="wi-top" :style="{ display: showinp }">
        <p>日期</p>
        <el-date-picker
          unlink-panels
          style="width:380px;"
          v-model="timeData"
          type="daterange"
          value-format="yyyy-MM-dd"
          format="yyyy-MM-dd"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        >
        </el-date-picker>

        <p>实进量</p>
        <el-input v-model="actualAmount" style="width:150px;">
          <!-- <template slot="append">{{this.stockJudgment}}</template> -->
          <template slot="prepend">>=</template>
        </el-input>

        <p>实销量</p>
        <el-input v-model="actualSell" class="top_inp">
          <!-- <template slot="append">{{this.stockJudgment}}</template> -->
          <template slot="prepend">>=</template>
        </el-input>
      </div>
    </div>

    <div class="wi-button">
      <div>
        <el-button @click="query" type="primary" icon="el-icon-search"
          >查询</el-button
        >
        <el-button @click="exportExcel" icon="el-icon-upload2">导出</el-button>
        <el-button
          @click="
            () => {
              this.Scn = 'block';
            }
          "
          icon="el-icon-copy-document"
          :disabled="Dis1"
          >筛选款号</el-button
        >
        <el-button @click="open" v-show="false">印</el-button>
      </div>
      <div>
        <div :style="{ display: showcheck }">
          <el-checkbox v-model="checked2" label="筛选款号" border></el-checkbox>
        </div>
        <el-checkbox v-model="isOne" label="二维" border></el-checkbox>
        <el-checkbox
          v-model="isContainCustomerRepertory"
          label="含客存"
          border
          :disabled="Dis2"
        ></el-checkbox>
        <el-checkbox v-model="checked5" label="显示图片" border></el-checkbox>
      </div>
    </div>

    <el-table
      :default-sort="{ prop: 'date', order: 'descending' }"
      :header-cell-style="{ background: '#f4f4f4', padding: 0, height: '40px' }"
      :cell-style="{ padding: 0, height: '26px' }"
      :data="tableData"
      border
      @row-click="rowClick"
      highlight-current-row
      :summary-method="getList"
      show-summary
      height="74vh"
      :span-method="spanMethod"
      style="width:100%;"
    >
      <el-table-column type="index" label="序号" width="50"> </el-table-column>
      <template v-for="i in wList">
        <el-table-column
          sortable
          :prop="i.prop"
          show-overflow-tooltip
          :key="i.prop + Math.random()"
          :label="i.label"
          :width="i.width"
          v-if="i.isShow"
        >
        </el-table-column>
      </template>
    </el-table>

    <!-- 显示图片 -->
    <!-- 通过display=‘block/none’来决定是否显示这个图片容器 -->
    <div id="pic" :style="{ display: Pic }">
      <div class="pic-top">
        <p>显示图片({{ num }})</p>
        <i
          @click="
            () => {
              (this.Pic = 'none'), (this.checked5 = false);
            }
          "
          class="el-icon-close"
        ></i>
      </div>
      <div v-for="(item, index) in this.details" :key="index">
        <img style="width:300px;height:355px;" :src="item.imageUrl" alt="" />
      </div>
    </div>

    <!-- 筛选框 -->
    <screen-num
      :style="{ display: Scn }"
      @closeScn="
        () => {
          this.Scn = 'none';
        }
      "
      @preservation="preservation"
    >
    </screen-num>

    <!-- 底部栏 -->
    <foot-view
      class="footView"
      :pagesNum="pagesNum"
      :hasPagination="true"
      :pageSize="limit"
      @handleSizeChange="handleSizeChange"
      @handleCurrentChange="handleCurrentChange"
    >
      <div slot="text">
        <el-popover
          placement="top-start"
          width="120"
          max-height="100px"
          trigger="click"
        >
          <el-checkbox-group v-model="selectHeaderList">
            <el-checkbox
              v-for="i in headerList"
              :label="i.value"
              :key="i.value"
              style="margin-bottom:7px"
            ></el-checkbox>
          </el-checkbox-group>
          <i slot="reference" class="el-icon-date"> 表头配置</i>
        </el-popover>
        <span>数据库：{{ jxQuarter }}</span>
      </div>
    </foot-view>

    <div id="p" v-show="false"></div>
    <!-- <print-page></print-page> -->
    <print-page
      v-show="false"
      :manufacturerName="manufacturerName"
    ></print-page>
  </div>
</template>

<script>
import printPage from "../../../components/PrintVendorStock";
var resources = require("../../../config/print");
import footView from "../../../components/FootView";
import screenNum from "./childComp/screenNum";
import { getANumber, getModel } from "../../../network/manufacturer";
import { getProductName } from "../../../network/productName";
import { getBranded } from "../../../network/branded";
import {
  getStock,
  getWarehouse,
  getTowStock,
  getSum,
  getSum1,
} from "../../../network/warehouse";
import { getQuarter, getNumber } from "../../../network/quarter";
import today from "../../../components/mixins/today";
import outex from "../../../components/mixins/outexp";
import enterUp from "../../../components/mixins/enterUp";
export default {
  name: "warehouse_inventory",
  mixins: [today, outex, enterUp],
  created() {
    this.inpList = this.getInput();
    // this.timeData = [this.getLastWeek1(),this.getNowTime1()]
    // console.log(this.timeData)
    this.wList = this.wList1;
    this.getCalculationList();
    //仓库
    getWarehouse().then((res) => {
      console.log(res.data);
      this.AList = res.data.data;
      this.AList.forEach((e) => {
        this.AAList.push({ value: e.no, label: e.name, value1: e.id });
        if (e.isMainWarehouse) {
          this.warehouseNo = e.no;
          this.warehouseName = e.name;
          this.warehouseId = e.id;
        }
      });
    });

    //品名
    getProductName().then((res) => {
      let list = res.data.data;
      list.forEach((e) => {
        this.nameList.push({ label: e.name, value: e.id });
      });
    });
    // 品牌公司查品牌
    getBranded().then((res) => {
      console.log(res);
      res.data.data.forEach((e) => {
        this.brandList.push({ value: e.id, label: e.name });
      });
    });

    //查询款号
    // getModel(JSON.stringify([''])).then(res=>{
    //   console.log(res.data)
    //   let list = res.data.data
    //   list.forEach(e=>{
    //     this.kindsNumberList.push({label:e.kindsNumber,value:e.kindsNumber})
    //   })
    // });
    // getNumber(JSON.stringify([''])).then(res => {
    //   console.log(res.data)
    //   if (res.data.code == 200) {
    //     res.data.data.forEach(e => {
    //       this.kindsNumberList.push({value:e.styleNumber,label:e.styleNumber})
    //     })
    //   }
    // })

    //季度
    getQuarter().then((res) => {
      console.log(res.data);
      let qList = res.data.data;
      qList.forEach((e) => {
        this.quartListStrList.push({ label: e.name, value: e.id });
      });
    });
  },

  components: {
    footView,
    screenNum,
    printPage,
  },

  data() {
    return {
      sortArr: [],
      manufacturerName: "1-1",
      sendList: [],
      sendList2: [],
      sendList3: [],
      sendList4: [],
      ary: ["仓库id", "货号id", "颜色", "仓库编号", "品牌id", "销退数量"],
      ary1: [
        "款色号",
        "仓库id",
        "c05客存数量",
        "c07客存数量",
        "c09客存数量",
        "c11客存数量",
        "c13客存数量",
        "c15客存数量",
        "c17客存数量",
        "c19客存数量",
        "c21客存数量",
        "c23客存数量",
        "f客存数量",
        "厂商库存数量",
        "客户库存数量",
      ],
      Dis1: true,
      Dis2: true,
      jxQuarter: document.cookie.match(RegExp("jxQuarter" + "=([^;]+)"))[1],
      //数据总条数
      dataLen: 0,
      //总页码数
      pagesNum: 0,
      //每页显示条数
      limit: 20,
      // 当前页码
      currentPage: 1,
      inpList: [],
      timeData: [],
      actualSell: "",
      actualAmount: "",
      CommodityNameId: "",
      brandedId: "",
      quartListStr: "",
      stock: "",
      stockJudgment: ">=",
      warehouseNo: "",
      warehouseName: "",
      warehouseId: "",
      kindsNumberListStr: "",
      kindsNumberList: [],
      AList: [],
      AAList: [],
      stockList: [
        { label: ">=", value: ">=" },
        { label: "=", value: "=" },
        { label: "<=", value: "<=" },
      ],
      nameList: [],
      brandList: [],

      List: [],
      selectHeaderList: ["仓库", "品牌", "款号", "尺码", "颜色"], //foot-view
      headerList: [
        { value: "仓库" },
        { value: "品牌" },
        { value: "款号" },
        { value: "尺码" },
        { value: "颜色" },
        // ,{value:'品名'},
      ],
      num: "",
      Pic: "none",
      Scn: "none",
      showinp: "none",
      showcheck: "block",
      conditionQuery: false,
      checked2: false,
      isOne: false,
      isContainCustomerRepertory: false,
      checked5: false,
      quartListStrList: [],
      wList: [],
      wList1: [
        { isShow: true, prop: "warehouseName", label: "仓库", width: "85px" },
        { isShow: true, prop: "brandedName", label: "品牌", width: "100px" },
        { isShow: true, prop: "styleNumber", label: "款号", width: "135px" },
        { isShow: true, prop: "colorNo", label: "颜色", width: "110px" },
        { isShow: true, prop: "size", label: "尺码", width: "75px" },
        // {isShow:true,prop:'commodityName',label: '品名'},
        {
          isShow: true,
          prop: "totalRepertoryNumber",
          label: "总存",
          width: "75px",
        },
        {
          isShow: true,
          prop: "factoryRepertoryNumber",
          label: "库存",
          width: "75px",
        },
        {
          isShow: true,
          prop: "customerRepertoryNumber",
          label: "客存",
          width: "75px",
        },
        {
          isShow: true,
          prop: "customerSellNumber",
          label: "客销",
          width: "75px",
        },
        {
          isShow: true,
          prop: "factoryInputNumber",
          label: "厂进",
          width: "75px",
        },
        {
          isShow: true,
          prop: "factoryOutNumber",
          label: "厂退",
          width: "75px",
        },
        {
          isShow: true,
          prop: "customerInputNumber",
          label: "客进",
          width: "75px",
        },
        {
          isShow: true,
          prop: "customerOutNumber",
          label: "客退",
          width: "75px",
        },
        { isShow: true, prop: "foldNumber", label: "调入", width: "75px" },
        { isShow: true, prop: "calloutNumber", label: "调出", width: "75px" },
        { isShow: true, prop: "differNumber", label: "盘差", width: "75px" },
        {
          isShow: true,
          prop: "depositRepertoryNumber",
          label: "上存",
          width: "75px",
        },
        // {prop:'principal',label: '本存',width:'75px'},
        {
          isShow: true,
          prop: "firstInputDate",
          label: "首进日",
          width: "100px",
        },
        {
          isShow: true,
          prop: "latelyInputDate",
          label: "近进日",
          width: "100px",
        },
        {
          isShow: true,
          prop: "firstSellDate",
          label: "首销日",
          width: "100px",
        },
        {
          isShow: true,
          prop: "latelySellDate",
          label: "近销日",
          width: "100px",
        },
      ],
      wList2: [
        {
          isShow: true,
          prop: "warehouseName",
          label: "仓库名称",
          width: "110",
        },
        { isShow: true, prop: "styleNumber", label: "款号", width: "110" },
        { isShow: true, prop: "brandName", label: "品牌", width: "100px" },
        // {isShow:true,prop:'typeColor',label: '型色码',width:'120px'},
        { isShow: true, prop: "colorNo", label: "颜色", width: "110px" },
        {
          isShow: true,
          prop: "commodityName",
          label: "品名名称",
          width: "110px",
        },
        {
          isShow: true,
          prop: "repertoryFiveNumber",
          label: "05-XS",
          width: "90px",
        },
        {
          isShow: true,
          prop: "repertorySevenNumber",
          label: "07-S",
          width: "85",
        },
        {
          isShow: true,
          prop: "repertoryNineNumber",
          label: "09-M",
          width: "85",
        },
        { isShow: true, prop: "repertoryElevenNumber", label: "11-L" },
        {
          isShow: true,
          prop: "repertoryThirteenNumber",
          label: "13-XL",
          width: "90px",
        },
        {
          isShow: true,
          prop: "repertoryFifteenNumber",
          label: "15-2L",
          width: "85",
        },
        {
          isShow: true,
          prop: "repertorySeventeenNumber",
          label: "17-3L",
          width: "85",
        },
        {
          isShow: true,
          prop: "repertoryNineteenNumber",
          label: "19-4L",
          width: "85",
        },
        {
          isShow: true,
          prop: "repertoryTwentyOneNumber",
          label: "21-5L",
          width: "85",
        },
        {
          isShow: true,
          prop: "repertoryTwentyThreeNumber",
          label: "23-6L",
          width: "85",
        },
        { isShow: true, prop: "repertoryFNumber", label: "D", width: "85" },
        // {prop:'f',label: 'D'},
        {
          isShow: true,
          prop: "totalRepertoryNumber",
          label: "小计",
          width: "100",
        },
        { isShow: true, prop: "sellingPrice", label: "售价", width: "90" },
        { isShow: true, prop: "money", label: "金额", width: "90" },
        {
          isShow: true,
          prop: "firstInputDate",
          label: "首进日",
          width: "120px",
        },
      ],
      tableData: [],
      tableData1: [],
      details: [],
      zt: "",
      calculationList: [],
      newArr: [],
      result: [],
      factoryInputNumber: "",
      factoryOutNumber: "",
      customerInputNumber: "",
      customerOutNumber: "",
      customerSellNumber: "",
      foldNumber: "",
      calloutNumber: "",
      differNumber: "",
      factoryRepertoryNumber: "",
      customerRepertoryNumber: "",
      totalRepertoryNumber: "",
      depositRepertoryNumber: "",
      repertoryFiveNumber: "",
      repertorySevenNumber: "",
      repertoryNineNumber: "",
      repertoryElevenNumber: "",
      repertoryThirteenNumber: "",
      repertoryFifteenNumber: "",
      repertorySeventeenNumber: "",
      repertoryNineteenNumber: "",
      repertoryTwentyOneNumber: "",
      repertoryTwentyThreeNumber: "",
      repertoryFNumber: "",
      money: "",
    };
  },

  methods: {
    spanMethod({ row, column, rowIndex, columnIndex }) {
      // console.log(row,column,rowIndex,columnIndex)
    },
    open() {
      //打印
      let printBody = document.getElementById("p");
      let printHead = document.createElement("div");
      printHead.innerHTML = `
      <span class="Head">仓库库存表</span>
      <div class="dTop">
        <p>地址</p>
        <p>电话</p>
      </div>
      <div class="dTop">
        <p>客户名称</p>
        <p>客户电话</p>
        <p>销售序号</p>
      </div>
      `;
      printHead.style.pageBreakBefore = "always"; //style="page-break-after:always"意思是下一行开始分页。 是css打印的一种格式。
      printBody.appendChild(printHead);

      let printTable = document.getElementById("printTable"); //子组件Dom id
      // console.log(printTable)
      let length = this.tableData.length;
      // console.log(length)
      for (let index = 0; index < length; index++) {
        const e = this.tableData[index];

        let row = printTable.insertRow(); //创建一行 row
        row.insertCell(0).innerHTML = index + 1; //row里 创建td赋值
        row.insertCell(1).innerHTML = e.styleNumber;
        row.insertCell(2).innerHTML = e.colorName;
        row.insertCell(3).innerHTML = e.commodityName;
        row.insertCell(4).innerHTML = e.repertoryFiveNumber;
        row.insertCell(5).innerHTML = e.repertorySevenNumber;
        row.insertCell(6).innerHTML = e.repertoryNineNumber;
        row.insertCell(7).innerHTML = e.repertoryElevenNumber;
        row.insertCell(8).innerHTML = e.repertoryThirteenNumber;
        row.insertCell(9).innerHTML = e.repertoryFifteenNumber;
        row.insertCell(10).innerHTML = e.repertorySeventeenNumber;
        row.insertCell(11).innerHTML = e.repertoryNineteenNumber;
        row.insertCell(12).innerHTML = e.repertoryTwentyOneNumber;
        row.insertCell(13).innerHTML = e.repertoryTwentyThreeNumber;
        row.insertCell(14).innerHTML = e.repertoryFNumber;
        row.insertCell(15).innerHTML = e.totalRepertoryNumber;
        row.insertCell(16).innerHTML = e.sellingPrice;
        row.insertCell(17).innerHTML = e.money;
        console.log(row);
      }
      printBody.appendChild(printTable);

      // return

      // let printTable = document.createElement('table')
      // printTable.innerHTML = `
      // <tr>
      //   <td width:'5%'>序号</td>
      //   <td width:'10%'>仓库</td>
      //   <td width:'12%'>品牌</td>
      //   <td width:'12%'>款号</td>
      //   <td width:'10%'>颜色</td>
      //   <td width:'10%'>尺寸</td>
      //   <td>库存</td>
      //   <td>客存</td>
      // </tr>
      // `
      // printBody.appendChild(printTable)

      let printHtml = document.getElementById("p").innerHTML;
      let wind = window.open(
        "",
        "newwindow",
        "height=500, width=1000, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no"
      );
      wind.document.body.innerHTML = printHtml;
      let style = document.createElement("style");
      style.type = "text/css";
      style.innerHTML = resources.printCss;
      wind.document.head.appendChild(style);
      wind.print();
    },

    aka(w, q) {
      w.totalRepertoryNumber =
        Number(q.totalRepertoryNumber) + Number(w.totalRepertoryNumber);
      w.factoryRepertoryNumber =
        Number(q.factoryRepertoryNumber) + Number(w.factoryRepertoryNumber);
      w.customerRepertoryNumber =
        Number(q.customerRepertoryNumber) + Number(w.customerRepertoryNumber);
      w.customerSellNumber =
        Number(q.customerSellNumber) + Number(w.customerSellNumber);
      w.factoryInputNumber =
        Number(q.factoryInputNumber) + Number(w.factoryInputNumber);
      w.factoryOutNumber =
        Number(q.factoryOutNumber) + Number(w.factoryOutNumber);
      w.customerInputNumber =
        Number(q.customerInputNumber) + Number(w.customerInputNumber);
      w.customerOutNumber =
        Number(q.customerOutNumber) + Number(w.customerOutNumber);
      w.foldNumber = Number(q.foldNumber) + Number(w.foldNumber);
      w.calloutNumber = Number(q.calloutNumber) + Number(w.calloutNumber);
      w.differNumber = Number(q.differNumber) + Number(w.differNumber);
      w.depositRepertoryNumber =
        Number(q.depositRepertoryNumber) + Number(w.depositRepertoryNumber);
    },
    //筛选
    Screen(Arr1) {
      let index = this.calculationList.indexOf("styleNumber");
      let index1 = this.calculationList.indexOf("colorNo");
      let index2 = this.calculationList.indexOf("brandedName");
      let index3 = this.calculationList.indexOf("size");
      let index4 = this.calculationList.indexOf("warehouseName");

      if (
        index != -1 &&
        index1 != -1 &&
        index2 != -1 &&
        index3 != -1 &&
        index4 != -1
      ) {
        //全选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].styleNumber == this.result[w].styleNumber &&
              Arr1[q].colorNo == this.result[w].colorNo &&
              Arr1[q].brandedName == this.result[w].brandedName &&
              Arr1[q].size == this.result[w].size &&
              Arr1[q].warehouseName == this.result[w].warehouseName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]); //调用共用函数赋值
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index == -1 &&
        index1 != -1 &&
        index2 != -1 &&
        index3 != -1 &&
        index4 != -1
      ) {
        //款号不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].size == this.result[w].size &&
              Arr1[q].colorNo == this.result[w].colorNo &&
              Arr1[q].brandedName == this.result[w].brandedName &&
              Arr1[q].warehouseName == this.result[w].warehouseName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index == -1 &&
        index1 == -1 &&
        index2 != -1 &&
        index3 != -1 &&
        index4 != -1
      ) {
        //款号 颜色不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].size == this.result[w].size &&
              Arr1[q].brandedName == this.result[w].brandedName &&
              Arr1[q].warehouseName == this.result[w].warehouseName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index == -1 &&
        index1 != -1 &&
        index2 == -1 &&
        index3 != -1 &&
        index4 != -1
      ) {
        //款号 品牌不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].size == this.result[w].size &&
              Arr1[q].colorNo == this.result[w].colorNo &&
              Arr1[q].warehouseName == this.result[w].warehouseName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index == -1 &&
        index1 != -1 &&
        index2 != -1 &&
        index3 == -1 &&
        index4 != -1
      ) {
        //款号 尺码不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].colorNo == this.result[w].colorNo &&
              Arr1[q].brandedName == this.result[w].brandedName &&
              Arr1[q].warehouseName == this.result[w].warehouseName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index == -1 &&
        index1 != -1 &&
        index2 != -1 &&
        index3 != -1 &&
        index4 == -1
      ) {
        //款号 仓库不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].size == this.result[w].size &&
              Arr1[q].colorNo == this.result[w].colorNo &&
              Arr1[q].brandedName == this.result[w].brandedName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index == -1 &&
        index1 == -1 &&
        index2 == -1 &&
        index3 != -1 &&
        index4 != -1
      ) {
        //款号 颜色 品牌不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].size == this.result[w].size &&
              Arr1[q].warehouseName == this.result[w].warehouseName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index == -1 &&
        index1 == -1 &&
        index2 != -1 &&
        index3 == -1 &&
        index4 != -1
      ) {
        //款号 颜色 尺寸不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].brandedName == this.result[w].brandedName &&
              Arr1[q].warehouseName == this.result[w].warehouseName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index == -1 &&
        index1 == -1 &&
        index2 != -1 &&
        index3 != -1 &&
        index4 == -1
      ) {
        //款号 颜色 仓库不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].brandedName == this.result[w].brandedName &&
              Arr1[q].size == this.result[w].size
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index == -1 &&
        index1 != -1 &&
        index2 == -1 &&
        index3 == -1 &&
        index4 != -1
      ) {
        //款号 品牌 尺寸不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].colorNo == this.result[w].colorNo &&
              Arr1[q].warehouseName == this.result[w].warehouseName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index == -1 &&
        index1 != -1 &&
        index2 == -1 &&
        index3 != -1 &&
        index4 == -1
      ) {
        //款号 品牌 仓库不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].colorNo == this.result[w].colorNo &&
              Arr1[q].size == this.result[w].size
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index == -1 &&
        index1 != -1 &&
        index2 != -1 &&
        index3 == -1 &&
        index4 == -1
      ) {
        //款号 尺寸 仓库不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].colorNo == this.result[w].colorNo &&
              Arr1[q].brandedName == this.result[w].brandedName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index != -1 &&
        index1 == -1 &&
        index2 != -1 &&
        index3 != -1 &&
        index4 != -1
      ) {
        //颜色不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].size == this.result[w].size &&
              Arr1[q].styleNumber == this.result[w].styleNumber &&
              Arr1[q].brandedName == this.result[w].brandedName &&
              Arr1[q].warehouseName == this.result[w].warehouseName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index != -1 &&
        index1 == -1 &&
        index2 == -1 &&
        index3 != -1 &&
        index4 != -1
      ) {
        //颜色 品牌不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].size == this.result[w].size &&
              Arr1[q].styleNumber == this.result[w].styleNumber &&
              Arr1[q].warehouseName == this.result[w].warehouseName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index != -1 &&
        index1 == -1 &&
        index2 != -1 &&
        index3 == -1 &&
        index4 != -1
      ) {
        //颜色 尺码不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].styleNumber == this.result[w].styleNumber &&
              Arr1[q].brandedName == this.result[w].brandedName &&
              Arr1[q].warehouseName == this.result[w].warehouseName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index != -1 &&
        index1 == -1 &&
        index2 != -1 &&
        index3 != -1 &&
        index4 == -1
      ) {
        //颜色 仓库不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].size == this.result[w].size &&
              Arr1[q].styleNumber == this.result[w].styleNumber &&
              Arr1[q].brandedName == this.result[w].brandedName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index != -1 &&
        index1 == -1 &&
        index2 == -1 &&
        index3 == -1 &&
        index4 != -1
      ) {
        //颜色 品牌 尺码不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].styleNumber == this.result[w].styleNumber &&
              Arr1[q].warehouseName == this.result[w].warehouseName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index != -1 &&
        index1 == -1 &&
        index2 == -1 &&
        index3 != -1 &&
        index4 == -1
      ) {
        //颜色 品牌 仓库不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].styleNumber == this.result[w].styleNumber &&
              Arr1[q].size == this.result[w].size
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index != -1 &&
        index1 == -1 &&
        index2 != -1 &&
        index3 == -1 &&
        index4 == -1
      ) {
        //颜色 尺寸 仓库不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].styleNumber == this.result[w].styleNumber &&
              Arr1[q].brandedName == this.result[w].brandedName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index != -1 &&
        index1 != -1 &&
        index2 == -1 &&
        index3 != -1 &&
        index4 != -1
      ) {
        //品牌不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].size == this.result[w].size &&
              Arr1[q].styleNumber == this.result[w].styleNumber &&
              Arr1[q].colorNo == this.result[w].colorNo &&
              Arr1[q].warehouseName == this.result[w].warehouseName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index != -1 &&
        index1 != -1 &&
        index2 == -1 &&
        index3 == -1 &&
        index4 != -1
      ) {
        //品牌 尺码不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].styleNumber == this.result[w].styleNumber &&
              Arr1[q].colorNo == this.result[w].colorNo &&
              Arr1[q].warehouseName == this.result[w].warehouseName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index != -1 &&
        index1 != -1 &&
        index2 == -1 &&
        index3 != -1 &&
        index4 == -1
      ) {
        //品牌 仓库不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].styleNumber == this.result[w].styleNumber &&
              Arr1[q].colorNo == this.result[w].colorNo &&
              Arr1[q].size == this.result[w].size
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index != -1 &&
        index1 != -1 &&
        index2 == -1 &&
        index3 == -1 &&
        index4 == -1
      ) {
        //品牌 尺码 仓库不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].styleNumber == this.result[w].styleNumber &&
              Arr1[q].colorNo == this.result[w].colorNo
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index != -1 &&
        index1 != -1 &&
        index2 != -1 &&
        index3 == -1 &&
        index4 != -1
      ) {
        //尺码不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].styleNumber == this.result[w].styleNumber &&
              Arr1[q].colorNo == this.result[w].colorNo &&
              Arr1[q].brandedName == this.result[w].brandedName &&
              Arr1[q].warehouseName == this.result[w].warehouseName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index != -1 &&
        index1 != -1 &&
        index2 != -1 &&
        index3 == -1 &&
        index4 == -1
      ) {
        //尺码 仓库不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].styleNumber == this.result[w].styleNumber &&
              Arr1[q].colorNo == this.result[w].colorNo &&
              Arr1[q].brandedName == this.result[w].brandedName
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index != -1 &&
        index1 != -1 &&
        index2 != -1 &&
        index3 != -1 &&
        index4 == -1
      ) {
        //仓库不选
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (
              Arr1[q].styleNumber == this.result[w].styleNumber &&
              Arr1[q].brandedName == this.result[w].brandedName &&
              Arr1[q].size == this.result[w].size &&
              Arr1[q].colorNo == this.result[w].colorNo
            ) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index != -1 &&
        index1 == -1 &&
        index2 == -1 &&
        index3 == -1 &&
        index4 == -1
      ) {
        //只有款号
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (Arr1[q].styleNumber == this.result[w].styleNumber) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index == -1 &&
        index1 != -1 &&
        index2 == -1 &&
        index3 == -1 &&
        index4 == -1
      ) {
        //只颜色
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (Arr1[q].colorNo == this.result[w].colorNo) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index == -1 &&
        index1 == -1 &&
        index2 != -1 &&
        index3 == -1 &&
        index4 == -1
      ) {
        //只品牌
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (Arr1[q].brandedName == this.result[w].brandedName) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index == -1 &&
        index1 == -1 &&
        index2 == -1 &&
        index3 != -1 &&
        index4 == -1
      ) {
        //只尺寸
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (Arr1[q].size == this.result[w].size) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      if (
        index == -1 &&
        index1 == -1 &&
        index2 == -1 &&
        index3 == -1 &&
        index4 != -1
      ) {
        //只仓库
        this.result = [];
        let flag = true;
        this.result.push(Arr1[0]);
        for (let q = 1; q < Arr1.length; q++) {
          flag = true;
          for (let w = 0; w < this.result.length; w++) {
            if (Arr1[q].warehouseName == this.result[w].warehouseName) {
              flag = false;
              this.aka(this.result[w], Arr1[q]);
            }
          }
          if (flag == true) this.result.push(Arr1[q]);
        }
        console.log(this.result);
        return;
      }

      // if(this.newArr == ''){Arr = Arr1}else{Arr = this.newArr}
      // let index1 = this.calculationList.indexOf('colorNo')
      // // console.log(index)
      // if(index1 != -1){
      //   for(let i in Arr){
      //     var key = Arr[i].colorNo;
      //     if(temp[key]) {
      //         temp[key].colorNo = temp[key].colorNo
      //         temp[key].totalRepertoryNumber = temp[key].totalRepertoryNumber + Arr[i].totalRepertoryNumber
      //         temp[key].factoryRepertoryNumber = Number(temp[key].factoryRepertoryNumber) + Number(Arr[i].factoryRepertoryNumber)
      //         temp[key].customerRepertoryNumber = temp[key].customerRepertoryNumber + Arr[i].customerRepertoryNumber
      //         temp[key].customerSellNumber = temp[key].customerSellNumber + Arr[i].customerSellNumber
      //         temp[key].factoryInputNumber = temp[key].factoryInputNumber + Arr[i].factoryInputNumber
      //         temp[key].factoryOutNumber = temp[key].factoryOutNumber + Arr[i].factoryOutNumber
      //         temp[key].foldNumber = temp[key].foldNumber + Arr[i].foldNumber
      //         temp[key].calloutNumber = temp[key].calloutNumber + Arr[i].calloutNumber
      //         temp[key].differNumber = temp[key].differNumber + Arr[i].differNumber
      //         temp[key].depositRepertoryNumber = temp[key].depositRepertoryNumber + Arr[i].depositRepertoryNumber
      //         temp[key].customerOutNumber = Number(temp[key].customerOutNumber) + Number(Arr[i].customerOutNumber)
      //         temp[key].customerInputNumber = temp[key].customerInputNumber + Arr[i].customerInputNumber
      //     }else{
      //         temp[key] = {};
      //         temp[key].colorNo = Arr[i].colorNo
      //         temp[key].totalRepertoryNumber = Arr[i].totalRepertoryNumber
      //         temp[key].factoryRepertoryNumber = Arr[i].factoryRepertoryNumber
      //         temp[key].customerRepertoryNumber = Arr[i].customerRepertoryNumber
      //         temp[key].customerSellNumber = Arr[i].customerSellNumber
      //         temp[key].factoryInputNumber = Arr[i].factoryInputNumber
      //         temp[key].factoryOutNumber = Arr[i].factoryOutNumber
      //         temp[key].foldNumber = Arr[i].foldNumber
      //         temp[key].calloutNumber = Arr[i].calloutNumber
      //         temp[key].differNumber = Arr[i].differNumber
      //         temp[key].depositRepertoryNumber = Arr[i].depositRepertoryNumber
      //         temp[key].customerOutNumber = Arr[i].customerOutNumber
      //         temp[key].customerInputNumber = Arr[i].customerInputNumber
      //     }
      //       temp[key].warehouseName = Arr[i].warehouseName
      //       temp[key].brandedName = Arr[i].brandedName
      //       temp[key].styleNumber = Arr[i].styleNumber
      //       temp[key].size = Arr[i].size
      //       temp[key].latelySellDate = Arr[i].latelySellDate
      //       temp[key].firstSellDate = Arr[i].firstSellDate
      //       temp[key].latelyInputDate = Arr[i].latelyInputDate
      //       temp[key].firstInputDate = Arr[i].firstInputDate
      //   }
      //   this.newArr = []
      //   for(let k in temp){
      //     this.newArr.push(temp[k])
      //   }
      //   console.log(this.newArr)
      //   temp = {}
      // };
    },

    getCalculationList() {
      this.calculationList = JSON.parse(JSON.stringify(this.selectHeaderList)); //实现深克隆 不改变 selectHeaderList的原始值
      for (let y in this.calculationList) {
        if (this.calculationList[y] == "款号") {
          this.calculationList[y] = "styleNumber";
        }
        if (this.calculationList[y] == "颜色") {
          this.calculationList[y] = "colorNo";
        }
        if (this.calculationList[y] == "仓库") {
          this.calculationList[y] = "warehouseName";
        }
        if (this.calculationList[y] == "品牌") {
          this.calculationList[y] = "brandedName";
        }
        if (this.calculationList[y] == "尺码") {
          this.calculationList[y] = "size";
        }
      }
      console.log(this.calculationList);
    },
    // querySearch(queryString,cb){
    //   let kindsNumberList = this.kindsNumberList
    //   let results = queryString ? kindsNumberList.filter(this.createFilter(queryString)) : kindsNumberList
    //   cb(results)
    // },
    // createFilter(queryString) {
    //   return (composition) => {
    //     return (composition.value.toLowerCase().indexOf(queryString.toLowerCase()) == 0);
    //   }
    // },
    exportExcel() {
      if (this.isOne) {
        let pageData = {
          limit: -1,
          page: 1,
        };
        let obj = {
          actualSell: this.actualSell,
          actualAmount: this.actualAmount,
          CommodityNameId:
            this.CommodityNameId == "" ? null : this.CommodityNameId,
          brandedId: this.brandedId == "" ? null : this.brandedId,
          quartIds:
            this.quartListStr == ""
              ? null
              : JSON.stringify(this.quartListStr).replace(/\[|]/g, ""),
          conditionQuery: this.conditionQuery,
          stock: this.stock,
          isContainCustomerRepertory: this.isContainCustomerRepertory,
          stockJudgment:
            this.stockJudgment == ">=" ? -1 : this.stockJudgment == "=" ? 1 : 0,
          warehouseId: this.warehouseId,
          styleNumberList:
            this.kindsNumberListStr == "" ? null : this.kindsNumberListStr,
          startDate:
            this.timeData == ""
              ? ""
              : this.timeData == null
              ? ""
              : Number(this.timeData[0].replace(/[-]/g, "")),
          endDate:
            this.timeData == ""
              ? ""
              : this.timeData == null
              ? ""
              : Number(this.timeData[1].replace(/[-]/g, "")),
          "pageData.page": this.currentPage,
          "pageData.limit": this.limit,
          customerId: -1,
          isExport: true,
          noExportList: JSON.stringify(this.ary1)
            .replace(/\[|]/g, "")
            .replace(/\"|"/g, ""),
        };
        // console.log(obj)
        getTowStock(obj).then((res) => {
          console.log(res.data);
          var ck = res.data.data;
          if (ck == null) {
            this.$message.warning({ message: "导出数据为空", offset: 400 });
            return;
          } else {
            location.href = `${ck}`; //获取到url后自动下载
          }
        });
      } else {
        let pageData = {
          limit: -1,
          page: 1,
        };
        let obj = {
          actualSell: this.actualSell,
          actualAmount: this.actualAmount,
          CommodityNameId:
            this.CommodityNameId == "" ? null : this.CommodityNameId,
          brandedId: this.brandedId == "" ? null : this.brandedId,
          quartIds:
            this.quartListStr == ""
              ? null
              : JSON.stringify(this.quartListStr).replace(/\[|]/g, ""),
          conditionQuery: this.conditionQuery,
          stock: this.stock,
          isContainCustomerRepertory: this.isContainCustomerRepertory,
          stockJudgment:
            this.stockJudgment == ">=" ? -1 : this.stockJudgment == "=" ? 1 : 0,
          warehouseId: this.warehouseId,
          styleNumberList:
            this.kindsNumberListStr == "" ? null : this.kindsNumberListStr,
          startDate:
            this.timeData == ""
              ? ""
              : this.timeData == null
              ? ""
              : Number(this.timeData[0].replace(/[-]/g, "")),
          endDate:
            this.timeData == ""
              ? ""
              : this.timeData == null
              ? ""
              : Number(this.timeData[1].replace(/[-]/g, "")),
          "pageData.page": this.currentPage,
          "pageData.limit": this.limit,
          customerId: -1,
          isExport: true,
          noExportList: JSON.stringify(this.ary)
            .replace(/\[|]/g, "")
            .replace(/\"|"/g, ""),
        };
        // console.log(obj)
        getStock(obj).then((res) => {
          console.log(res.data);
          var ck = res.data.data;
          if (ck == null) {
            this.$message.warning({ message: "导出数据为空", offset: 400 });
            return;
          } else {
            location.href = `${ck}`; //获取到url后自动下载
          }
        });
      }
    },
    handleSizeChange(val) {
      //每页多少条
      this.limit = val;
      //总页码
      this.pagesNum = Math.ceil(this.dataLen / this.limit);
      if (this.isOne == false) {
        this._getStock();
      } else {
        this._getTowStock();
      }
    },
    handleCurrentChange(val) {
      //当前页
      this.currentPage = val;
      if (this.isOne == false) {
        this._getStock();
      } else {
        this._getTowStock();
      }
    },
    query() {
      //遍历每一个加上单引号
      // let a = ''
      // this.kindsNumberListStr.forEach(e=>{
      //   if(!a){
      //     a = `'${e}'`
      //   }
      //   else{
      //     a = `${a},'${e}'`
      //   }
      //   console.log(a)
      // })
      if (this.isOne == false) {
        this._getStock();
      } else {
        this._getTowStock();
      }
    },
    //一维
    _getStock() {
      let pageData = {
        limit: this.limit,
        page: this.currentPage,
      };
      let obj = {
        actualSell: this.actualSell,
        actualAmount: this.actualAmount,
        CommodityNameId:
          this.CommodityNameId == "" ? null : this.CommodityNameId,
        brandedId: this.brandedId == "" ? null : this.brandedId,
        quartIds:
          this.quartListStr == ""
            ? null
            : JSON.stringify(this.quartListStr).replace(/\[|]/g, ""),
        conditionQuery: this.conditionQuery,
        stock: this.stock,
        isContainCustomerRepertory: this.isContainCustomerRepertory,
        stockJudgment:
          this.stockJudgment == ">=" ? -1 : this.stockJudgment == "=" ? 1 : 0,
        warehouseId: this.warehouseId,
        styleNumberList:
          this.kindsNumberListStr == "" ? null : this.kindsNumberListStr,
        startDate:
          this.timeData == ""
            ? ""
            : this.timeData == null
            ? ""
            : Number(this.timeData[0].replace(/[-]/g, "")),
        endDate:
          this.timeData == ""
            ? ""
            : this.timeData == null
            ? ""
            : Number(this.timeData[1].replace(/[-]/g, "")),
        "pageData.page": this.currentPage,
        "pageData.limit": this.limit,
        customerId: -1,
        isExport: false,
      };

      // console.log(obj)
      //数量汇总
      getSum(obj).then((res) => {
        console.log(res.data);
        if (res.data.data != null) {
          this.factoryInputNumber = res.data.data.factoryInputNumber;
          this.factoryOutNumber = res.data.data.factoryOutNumber;
          this.customerInputNumber = res.data.data.customerInputNumber;
          this.customerOutNumber = res.data.data.customerOutNumber;
          this.customerSellNumber = res.data.data.customerSellNumber;
          this.foldNumber = res.data.data.foldNumber;
          this.calloutNumber = res.data.data.calloutNumber;
          this.differNumber = res.data.data.differNumber;
          this.factoryRepertoryNumber = res.data.data.factoryRepertoryNumber;
          this.customerRepertoryNumber = res.data.data.customerRepertoryNumber;
          this.totalRepertoryNumber = res.data.data.totalRepertoryNumber;
          this.depositRepertoryNumber = res.data.data.depositRepertoryNumber;
        }
      });

      getStock(obj).then((res) => {
        // console.log(res.data)
        if (res.data.code == 200 && res.data.data != null) {
          for (let t in res.data.data) {
            res.data.data[
              t
            ].colorNo = `${res.data.data[t].colorNo} - ${res.data.data[t].colorName}`;
            if (res.data.data[t].totalRepertoryNumber == 0) {
              res.data.data[t].totalRepertoryNumber = "";
            }
            if (res.data.data[t].factoryRepertoryNumber == 0) {
              res.data.data[t].factoryRepertoryNumber = "";
            }
            if (res.data.data[t].customerRepertoryNumber == 0) {
              res.data.data[t].customerRepertoryNumber = "";
            }
            if (res.data.data[t].customerSellNumber == 0) {
              res.data.data[t].customerSellNumber = "";
            }
            if (res.data.data[t].factoryInputNumber == 0) {
              res.data.data[t].factoryInputNumber = "";
            }
            if (res.data.data[t].factoryOutNumber == 0) {
              res.data.data[t].factoryOutNumber = "";
            }
            if (res.data.data[t].customerInputNumber == 0) {
              res.data.data[t].customerInputNumber = "";
            }
            if (res.data.data[t].customerOutNumber == 0) {
              res.data.data[t].customerOutNumber = "";
            }
            if (res.data.data[t].foldNumber == 0) {
              res.data.data[t].foldNumber = "";
            }
            if (res.data.data[t].calloutNumber == 0) {
              res.data.data[t].calloutNumber = "";
            }
            if (res.data.data[t].differNumber == 0) {
              res.data.data[t].differNumber = "";
            }

            if (res.data.data[t].firstInputDate == null) {
              res.data.data[t].firstInputDate = "";
            } else {
              res.data.data[t].firstInputDate =
                String(res.data.data[t].firstInputDate).slice(0, 4) +
                "-" +
                String(res.data.data[t].firstInputDate).slice(4, 6) +
                "-" +
                String(res.data.data[t].firstInputDate).slice(6, 8);
            }
            if (res.data.data[t].latelyInputDate == null) {
              res.data.data[t].latelyInputDate = "";
            } else {
              res.data.data[t].latelyInputDate =
                String(res.data.data[t].latelyInputDate).slice(0, 4) +
                "-" +
                String(res.data.data[t].latelyInputDate).slice(4, 6) +
                "-" +
                String(res.data.data[t].latelyInputDate).slice(6, 8);
            }
            if (res.data.data[t].firstSellDate == null) {
              res.data.data[t].firstSellDate = "";
            } else {
              res.data.data[t].firstSellDate =
                String(res.data.data[t].firstSellDate).slice(0, 4) +
                "-" +
                String(res.data.data[t].firstSellDate).slice(4, 6) +
                "-" +
                String(res.data.data[t].firstSellDate).slice(6, 8);
            }
            if (res.data.data[t].latelySellDate == null) {
              res.data.data[t].latelySellDate = "";
            } else {
              res.data.data[t].latelySellDate =
                String(res.data.data[t].latelySellDate).slice(0, 4) +
                "-" +
                String(res.data.data[t].latelySellDate).slice(4, 6) +
                "-" +
                String(res.data.data[t].latelySellDate).slice(6, 8);
            }
            if (res.data.data[t].depositRepertoryNumber == 0) {
              res.data.data[t].depositRepertoryNumber = "";
            }
          }

          this.allData = res.data.data;
          let arrSortMinToMax = (a, b) => {
            let cReg = /^[\u4E00-\u9FCC\u3400-\u4DB5\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\ud840-\ud868][\udc00-\udfff]|\ud869[\udc00-\uded6\udf00-\udfff]|[\ud86a-\ud86c][\udc00-\udfff]|\ud86d[\udc00-\udf34\udf40-\udfff]|\ud86e[\udc00-\udc1d]/;
            if (!cReg.test(a.styleNumber) || !cReg.test(b.styleNumber)) {
              return a.styleNumber.localeCompare(b.styleNumber);
            } else {
              return a.styleNumber.localeCompare(b.styleNumber, "zh");
            }
          };
          // let arr = [{ name: "d" }, { name: "江" }, { name: "8" }, { name: "w" }, { name: "1" }, { name: "水" }]
          this.sortArr = this.allData.sort(arrSortMinToMax);
          console.log(this.sortArr); //  数组中 英文数组组合  排序 数字优先
          this.Screen(this.sortArr);

          this.dataLen = res.data.total;
          // this.tableData = this.allData.slice((this.currentPage-1)*this.limit,this.currentPage*this.limit)
          if (this.result != "") {
            this.tableData = this.result;
          } else {
            this.tableData = this.sortArr;
          }
        } else if (res.data.data == null) {
          this.tableData = [];
          this.currentPage = 1;
          this.dataLen = 0;
        }
      });
    },
    //二维
    _getTowStock() {
      let pageData = {
        limit: this.limit,
        page: this.currentPage,
      };
      let obj = {
        actualSell: this.actualSell,
        actualAmount: this.actualAmount,
        CommodityNameId:
          this.CommodityNameId == "" ? null : this.CommodityNameId,
        brandedId: this.brandedId == "" ? null : this.brandedId,
        quartIds:
          this.quartListStr == ""
            ? null
            : JSON.stringify(this.quartListStr).replace(/\[|]/g, ""),
        conditionQuery: this.conditionQuery,
        stock: this.stock,
        isContainCustomerRepertory: this.isContainCustomerRepertory,
        stockJudgment:
          this.stockJudgment == ">=" ? -1 : this.stockJudgment == "=" ? 1 : 0,
        warehouseId: this.warehouseId,
        styleNumberList:
          this.kindsNumberListStr == "" ? null : this.kindsNumberListStr,
        startDate:
          this.timeData == ""
            ? ""
            : this.timeData == null
            ? ""
            : Number(this.timeData[0].replace(/[-]/g, "")),
        endDate:
          this.timeData == ""
            ? ""
            : this.timeData == null
            ? ""
            : Number(this.timeData[1].replace(/[-]/g, "")),
        "pageData.page": this.currentPage,
        "pageData.limit": this.limit,
        customerId: -1,
        isExport: false,
      };
      // console.log(obj)
      //数量汇总
      getSum1(obj).then((res) => {
        console.log(res.data);
        this.repertoryFiveNumber = res.data.data.repertoryFiveNumber;
        this.repertorySevenNumber = res.data.data.repertorySevenNumber;
        this.repertoryNineNumber = res.data.data.repertoryNineNumber;
        this.repertoryElevenNumber = res.data.data.repertoryElevenNumber;
        this.repertoryThirteenNumber = res.data.data.repertoryThirteenNumber;
        this.repertoryFifteenNumber = res.data.data.repertoryFifteenNumber;
        this.repertorySeventeenNumber = res.data.data.repertorySeventeenNumber;
        this.repertoryNineteenNumber = res.data.data.repertoryNineteenNumber;
        this.repertoryTwentyOneNumber = res.data.data.repertoryTwentyOneNumber;
        this.repertoryTwentyThreeNumber =
          res.data.data.repertoryTwentyThreeNumber;
        this.repertoryFNumber = res.data.data.repertoryFNumber;
        this.totalRepertoryNumber = res.data.data.totalRepertoryNumber;
        this.money = res.data.data.money;
      });
      getTowStock(obj).then((res) => {
        // console.log(res)
        if (res.data.code == 200 && res.data.data != null) {
          this.dataLen = res.data.total;
          // this.tableData = this.allData.slice((this.currentPage-1)*this.limit,this.currentPage*this.limit)
          this.tableData = res.data.data;
          for (let r in this.tableData) {
            this.tableData[
              r
            ].colorNo = `${this.tableData[r].colorNo} - ${this.tableData[r].colorName}`;
            if (this.tableData[r].firstInputDate == null) {
              this.tableData[r].firstInputDate = "";
            } else {
              this.tableData[r].firstInputDate =
                String(this.tableData[r].firstInputDate).slice(0, 4) +
                "-" +
                String(this.tableData[r].firstInputDate).slice(4, 6) +
                "-" +
                String(this.tableData[r].firstInputDate).slice(6, 8);
            }
            if (this.tableData[r].repertoryFiveNumber == 0) {
              this.tableData[r].repertoryFiveNumber = "";
            }
            if (this.tableData[r].totalRepertoryNumber == 0) {
              this.tableData[r].totalRepertoryNumber = "";
            }
            if (this.tableData[r].repertorySevenNumber == 0) {
              this.tableData[r].repertorySevenNumber = "";
            }
            if (this.tableData[r].repertoryNineNumber == 0) {
              this.tableData[r].repertoryNineNumber = "";
            }
            if (this.tableData[r].repertoryElevenNumber == 0) {
              this.tableData[r].repertoryElevenNumber = "";
            }
            if (this.tableData[r].repertoryThirteenNumber == 0) {
              this.tableData[r].repertoryThirteenNumber = "";
            }
            if (this.tableData[r].repertoryFifteenNumber == 0) {
              this.tableData[r].repertoryFifteenNumber = "";
            }
            if (this.tableData[r].repertorySeventeenNumber == 0) {
              this.tableData[r].repertorySeventeenNumber = "";
            }
            if (this.tableData[r].repertoryNineteenNumber == 0) {
              this.tableData[r].repertoryNineteenNumber = "";
            }
            if (this.tableData[r].repertoryTwentyOneNumber == 0) {
              this.tableData[r].repertoryTwentyOneNumber = "";
            }
            if (this.tableData[r].repertoryTwentyThreeNumber == 0) {
              this.tableData[r].repertoryTwentyThreeNumber = "";
            }
            if (this.tableData[r].repertoryFNumber == 0) {
              this.tableData[r].repertoryFNumber = "";
            }
            if (this.tableData[r].sellingPrice == 0) {
              this.tableData[r].sellingPrice = "";
            }
            if (this.tableData[r].money == 0) {
              this.tableData[r].money = "";
            }
          }

          // this.allData = res.data.data

          //   let arrSortMinToMax = (a, b) => {
          //   let cReg = /^[\u4E00-\u9FCC\u3400-\u4DB5\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\ud840-\ud868][\udc00-\udfff]|\ud869[\udc00-\uded6\udf00-\udfff]|[\ud86a-\ud86c][\udc00-\udfff]|\ud86d[\udc00-\udf34\udf40-\udfff]|\ud86e[\udc00-\udc1d]/
          //   if (!cReg.test(a.styleNumber) || !cReg.test(b.styleNumber)) {
          //     return a.styleNumber.localeCompare(b.styleNumber)
          //   } else {
          //     return a.styleNumber.localeCompare(b.styleNumber, "zh")
          //   }
          // }

          // let sortArr = this.allData.sort(arrSortMinToMax)
          // console.log(sortArr) //  数组中 英文数组组合  排序 数字优先
        } else if (res.data.data == null) {
          this.tableData = [];
          this.currentPage = 1;
          this.dataLen = 0;
        }
      });
    },

    //筛选款号查询
    preservation(data) {
      // console.log(data[0])
      // console.log(data[1])
      (this.quartListStr = data[0]),
        (this.kindsNumberListStr = JSON.stringify(data[1])
          .replace(/\[|]/g, "")
          .replace(/\"|"/g, "")), //转数组去中括号
        console.log(this.quartListStr, this.kindsNumberListStr);
    },

    //仓库编号框失去焦点
    Qname() {
      if (this.warehouseNo != "") {
        for (const i of this.AAList) {
          if (this.warehouseNo == i.value) {
            this.warehouseName = i.label;
            this.warehouseId = i.id;
            return;
          }
        }
      } else {
        this.warehouseId = "";
      }
    },
    change() {
      for (let u of this.AAList) {
        if (u.value == this.warehouseName) {
          this.warehouseNo = u.value;
          this.warehouseId = u.value1;
        }
      }
      if (this.warehouseName == "") {
        this.warehouseNo = "";
        this.warehouseId = "";
      }
    },

    //指定列求和
    getList(param) {
      // console.log(this.zt)
      if (this.zt == "null") {
        return;
      } else {
        const { columns, data } = param;
        const sums = [];
        columns.forEach((column, index) => {
          if (index === 0) {
            sums[index] = "合计";
            return;
          }
          // const values = data.map(item => Number(item[column.property]));
          //     if (column.property === 'repertoryFiveNumber' || column.property === 'repertorySevenNumber' ||
          //         column.property === 'repertoryNineNumber' || column.property === 'repertoryElevenNumber' ||
          //         column.property === 'repertoryThirteenNumber' || column.property === 'repertoryFifteenNumber' ||
          //         column.property === 'repertorySeventeenNumber' || column.property === 'repertoryNineteenNumber' ||
          //         column.property === 'repertoryTwentyOneNumber' || column.property === 'repertoryTwentyThreeNumber' ||
          //         column.property === 'sellingPrice' || column.property === 'totalRepertoryNumber' ||
          //         column.property === 'money' ||//二维
          //         column.property === 'repertoryFNumber' || column.property === 'factoryRepertoryNumber' ||
          //         column.property === 'customerRepertoryNumber' || column.property === 'factoryInputNumber' ||
          //         column.property === 'factoryInput' || column.property === 'customerSellNumber' ||
          //         column.property === 'customerInputNumber' || column.property === 'customerOutNumber' ||
          //         column.property === 'foldNumber' || column.property === 'calloutNumber' ||
          //         column.property === 'factoryOutNumber' || column.property === 'differNumber' ||
          //         column.property === 'depositRepertoryNumber' || column.property === 'totalRepertoryNumber') {
          //     sums[index] = values.reduce((prev, curr) => {
          //       const value = Number(curr);
          //       if (!isNaN(value)) {
          //         return prev + curr;
          //       } else {
          //         return prev;
          //       }
          //     }, 0);
          //     sums[index];
          //     }
          const prop = column.property;
          switch (prop) {
            case "factoryInputNumber":
              sums[index] = this.factoryInputNumber || "";
              break;
            case "factoryOutNumber":
              sums[index] = this.factoryOutNumber || "";
              break;
            case "customerInputNumber":
              sums[index] = this.customerInputNumber || "";
              break;
            case "customerOutNumber":
              sums[index] = this.customerOutNumber || "";
              break;
            case "customerSellNumber":
              sums[index] = this.customerSellNumber || "";
              break;
            case "foldNumber":
              sums[index] = this.foldNumber || "";
              break;
            case "calloutNumber":
              sums[index] = this.calloutNumber || "";
              break;
            case "differNumber":
              sums[index] = this.differNumber || "";
              break;
            case "factoryRepertoryNumber":
              sums[index] = this.factoryRepertoryNumber || "";
              break;
            case "customerRepertoryNumber":
              sums[index] = this.customerRepertoryNumber || "";
              break;
            case "totalRepertoryNumber":
              sums[index] = this.totalRepertoryNumber || "";
              break;
            case "depositRepertoryNumber":
              sums[index] = this.depositRepertoryNumber || "";
              break;

            case "repertoryFiveNumber":
              sums[index] = this.repertoryFiveNumber || "";
              break;
            case "repertorySevenNumber":
              sums[index] = this.repertorySevenNumber || "";
              break;
            case "repertoryNineNumber":
              sums[index] = this.repertoryNineNumber || "";
              break;
            case "repertoryElevenNumber":
              sums[index] = this.repertoryElevenNumber || "";
              break;
            case "repertoryThirteenNumber":
              sums[index] = this.repertoryThirteenNumber || "";
              break;
            case "repertoryFifteenNumber":
              sums[index] = this.repertoryFifteenNumber || "";
              break;
            case "repertorySeventeenNumber":
              sums[index] = this.repertorySeventeenNumber || "";
              break;
            case "repertoryNineteenNumber":
              sums[index] = this.repertoryNineteenNumber || "";
              break;
            case "repertoryTwentyOneNumber":
              sums[index] = this.repertoryTwentyOneNumber || "";
              break;
            case "repertoryTwentyThreeNumber":
              sums[index] = this.repertoryTwentyThreeNumber || "";
              break;
            case "repertoryFNumber":
              sums[index] = this.repertoryFNumber || "";
              break;
            // case 'totalRepertoryNumber' :
            //   sums[index] = this.totalRepertoryNumber || ''
            //   break;
            case "money":
              sums[index] = this.money || "";
              break;
          }
        });
        return sums;
      }
    },

    rowClick(e) {
      // console.log(e,e.imageUrl)
      this.details = [e];
      this.num = e.styleNumber;
    },
  },

  watch: {
    kindsNumberListStr(a, b) {
      if (a) {
        this.kindsNumberListStr = a
          .toUpperCase()
          .trim()
          .replace(/，/gi, ","); //中文逗号转英文
      }
    },
    //是否含客存
    isContainCustomerRepertory(a, b) {
      this.query();
    },
    conditionQuery(a, b) {
      if (a) {
        this.showinp = "block";
        this.showcheck = "none";
      } else {
        this.showinp = "none";
        this.showcheck = "block";
      }
    },
    isOne(a, b) {
      if (a) {
        this.Dis2 = false;
        this.wList = this.wList2;

        this.dataLen = 0;
        this.currentPage = 1;
        this._getTowStock();
        // this.dataLen = this.twoData.length
        // this.tableData = this.twoData.slice((this.currentPage-1)*this.limit,this.currentPage*this.limit)
      } else {
        this.wList = this.wList1;
        this.dataLen = 0;
        this.currentPage = 1;
        this._getStock();
        this.Dis2 = true;
        this.isContainCustomerRepertory = false;
      }
    },
    checked5(a, b) {
      if (a) {
        this.Pic = "block";
      } else {
        this.Pic = "none";
      }
    },

    dataLen(a, b) {
      this.pagesNum = Math.ceil(this.dataLen / this.limit);
    },
    limit(a, b) {
      this.pagesNum = Math.ceil(this.dataLen / this.limit);
    },

    checked2(a, b) {
      if (a) {
        this.Dis1 = false;
      } else {
        this.Dis1 = true;
      }
    },
    //表头设置
    selectHeaderList(a, b) {
      // console.log(a)
      this.getCalculationList();
      if (!this.isOne) {
        // this._getStock()
        this.Screen(this.sortArr);
        if (this.result != "") {
          this.tableData = this.result;
        } else {
          this.tableData = this.sortArr;
        }
      }

      this.headerList.forEach((e) => {
        this.sendList = [];
        this.sendList2 = [];
        if (a.indexOf(e.value) == -1) {
          this.sendList = this.wList1.filter((i) => {
            return i.label == e.value;
          });
          if (this.sendList.length) {
            this.sendList[0].isShow = false;
          }

          this.sendList.forEach((e) => {
            this.sendList3.push(e.label);
          });
          // console.log(this.sendList3)
          this.ary = [
            "仓库id",
            "货号id",
            "颜色",
            "仓库编号",
            "品牌id",
            "销退数量",
          ];
          for (let i = 0; i < this.sendList3.length; i++) {
            //数组去重
            var d = this.sendList3[i];
            if (this.ary.indexOf(d) == -1) {
              this.ary.push(this.sendList3[i]);
            }
          }
          // console.log(this.ary)

          this.sendList2 = this.wList2.filter((i) => {
            return i.label == e.value;
          });
          if (this.sendList2.length) this.sendList2[0].isShow = false;

          this.sendList2.forEach((e) => {
            this.sendList4.push(e.label);
          });
          this.ary1 = [
            "款色号",
            "仓库id",
            "c05客存数量",
            "c07客存数量",
            "c09客存数量",
            "c11客存数量",
            "c13客存数量",
            "c15客存数量",
            "c17客存数量",
            "c19客存数量",
            "c21客存数量",
            "c23客存数量",
            "f客存数量",
            "厂商库存数量",
            "客户库存数量",
          ];
          for (let t = 0; t < this.sendList4.length; t++) {
            if (this.ary1.indexOf(this.sendList4[t]) == -1) {
              this.ary1.push(this.sendList4[t]);
            }
          }
          // console.log(this.ary1)
        } else {
          this.sendList = this.wList1.filter((i) => {
            return i.label == e.value;
          });
          if (this.sendList.length) this.sendList[0].isShow = true;
          this.sendList2 = this.wList2.filter((i) => {
            return i.label == e.value;
          });
          if (this.sendList2.length) this.sendList2[0].isShow = true;
        }
      });
    },
  },
  // 不写在配置项的方法，就和普通的js没有区别，组件被创建的时候，马上就会执行一遍
  mounted() {
    pic.onmousedown = function(event) {
      console.log("ok");
      let pic = document.getElementById("pic");
      let rex = event.clientX - pic.offsetLeft;
      let rey = event.clientY - pic.offsetTop;
      document.onmousemove = (e) => {
        let xX = 0;
        let yY = 0;
        xX = e.clientX;
        yY = e.clientY;
        pic.style.left = xX - rex + "px";
        pic.style.top = yY - rey + "px";
      };
    };
    document.onmouseup = () => {
      document.onmousemove = null;
    };
  },
};
</script>
